<?php
use  yii\helpers\Url;
use  yii\helpers\Html;
$menu    = \backend\modules\models\setting\Menu::findOne(['name'=>'社会责任']);
$content = $menu->getLimitContent(3);
$main    = \backend\modules\models\setting\Menu::findOne(['name'=>'社会责任','parent_id'=>0]);
?>
<div class="col-md-8">
    <div class="row">
        <div class="col-md-12">
            <div class="model-title">
                <div>社会责任</div>
                <div class="title-line"></div>
                <i class="iconfont icon-xindiantu"></i>
                <button type="button" class="btn btn-danger btn-more btn-more-society" data-id="10">
                    <a href="<?= Url::to(['site/menu','menu_id'=>$main?$main->id:0])?>">更多</a>
                </button>
            </div>
        </div>
        <div class="col-md-12">
            <div class="row social-wrap">
                <?php if ($content) {?>
                    <?php foreach ($content as $one => $first): ?>
                        <div class="col-md-4">
                            <a class="card text-center mb-4 shadow-sm a-href" href="<?= Url::to(['site/content','content_id'=>$first->id])?>" data-id="<?= Html::encode($first->id)?>">
                                <img src="<?= Html::encode($first->image)?>" alt="" />
                                <div class="card-body">
                                    <h7 class="text-danger"><?= Html::encode($first->title)?></h7>
                                    <p class="card-text"><?= Html::encode($first->resume)?></p>
                                </div>
                            </a>
                        </div>
                    <?php endforeach ?>
                <?php }?>
            </div>
        </div>
    </div>
</div>